package com.vcourse.service.edu.controller.api;

import com.vcourse.cloud.vod.api.feign.VodMediaService;
import com.vcourse.commons.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Zengsh123
 * @date 2020-06-17 13:50
 */
@Api("前台课时接口")
@RestController
@RequestMapping("/api/edu/video")
public class ApiVideoController {
    @Resource
    private VodMediaService vodMediaService;

    @ApiOperation("获取视频播放凭证")
    @GetMapping("get-play-auth/{videoSourceId}")
    public R getPlayAuth(
            @ApiParam(value = "阿里云视频文件的id", required = true)
            @PathVariable String videoSourceId) {
        return vodMediaService.getPlayAuth(videoSourceId);
    }
}
